package 面向对象初级.类和对象;

public class Car {
    String color = "红色";
    int num = 4;

    void show() {
        System.out.println("color=" + color + ",num=" + num);
    }
}

class CarTest {
    public static void main(String[] args) {
        Car car1 = new Car();
        Car car2 = new Car();
        //重新赋值
        car1.color = "蓝色";
        car1.show();
        car2.num = 6;
        car2.show();
    }
}
